<template>
  <div class="workOverview">
    <el-card shadow="never">
      <div slot="header" class="clearfix">
        <span class="card-title">工作总览</span>
      </div>
      <el-row :gutter="30">
        <el-col :span="6">
          <div class="col-item">
            <span class="label">县级上报</span>
            <div class="item-right">
              <span>待上报：<span style="color: red">{{workData.countyWaitReport || 0}}/{{workData.countyCount  || 0}}</span></span>
              <span>已上报：<span style="color: #159b5a">{{workData.countyReport || 0}}/{{workData.countyCount  || 0}}</span></span>
            </div>
          </div>
        </el-col>
        <el-col :span="6">
          <div class="col-item">
            <span class="label">市级审核</span>
            <div class="item-right">
              <span>待审核：<span style="color: red">{{ workData.cityWaitApproval  || 0}}</span></span>
              <span>已审核：<span style="color: #159b5a">{{workData.cityApproval  || 0}}</span></span>
            </div>
          </div>
        </el-col>
        <el-col :span="6">
          <div class="col-item">
            <span class="label">省级审核</span>
            <div class="item-right">
              <span>待审核：<span style="color: red">{{workData.provinceWaitApproval  || 0}}</span></span>
              <span>已审核：<span style="color: #159b5a">{{workData.provinceApproval  || 0}}</span></span>
            </div>
          </div>
        </el-col>
        <el-col :span="6">
          <div class="col-item">
            <span class="label">市级上报</span>
            <div class="item-right">
              <span>待上报：<span style="color: red">{{workData.cityWaitReport  || 0}}</span></span>
              <span>已上报：<span style="color: #159b5a">{{workData.cityReport  || 0}}</span></span>
            </div>
          </div>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script lang="ts">
import {Component, Vue,Prop,Watch} from 'vue-property-decorator';
import {workOverview} from "@/api/investWork";

@Component
export default class WorkOverview extends Vue {
  workData:any = {}
  @Prop() private workId!:any;
  @Watch('workId')
  workIdChange(val) {
    console.log(val)
    this.search()
  }
  async search(){
    if(this.workId){
      let res = await workOverview(this.workId)
      if(res.data){
        this.workData = res.data
      }
    }
  }
  mounted() {
    this.search()
  }
}
</script>
<style lang="scss" scoped>
.workOverview {
  .col-item{
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    border: 1px solid #ececec;
    height: 80px;
    justify-content: center;
    .label{
      color: #006400;
    }
    .item-right{
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
  }
}
</style>
